package com.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.project.entity.GlobalTime;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * ClassName: GlobalTimeMapper
 * Package: com.project.mapper
 * Description:
 *
 * @Author 看到风
 * @Create 2023/11/6 17:56
 * @Version 1.0
 */
@Mapper
public interface GlobalTimeMapper extends BaseMapper<GlobalTime>{

     //设置
     public void save(GlobalTime globalTime);

     //查找
     public GlobalTime selectTime(int code,Long projectId);

     //更新
     public void update(GlobalTime globalTime);

     //获取开始时间
     @Select("select begin_date from global_time where code=#{code} and project_id=#{projectId}")
     public LocalDateTime getBegin(int code,Long projectId);
     //获取结束时间
     @Select("select end_date from global_time where code=#{code} and project_id=#{projectId}")
     public LocalDateTime getEnd(int code,Long projectId);
}
